package java_jc_cs;

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Arrays;


public class T1 {
    /*
    //用于创建模板
    @Test
    public void T_() throws IOException {
        String p_s1="E:\\java\\Test\\src\\java_jc_cs\\_";
        String p_s2=".java";
        String t_s1="package java_jc_cs;\n\npublic class _";
        String t_s2="{\n\n}";
        for (int i=98;i<106;i++) {
            Path path = Path.of(p_s1+i+p_s2);
            Files.createFile(path);
            Files.writeString(path, t_s1+i+t_s2);
        }

    }
    */
    @Test
    public void T_96(){
        _96 a=new _96();
        a.sort();
    }
    @Test
    public void T_97(){
        _97 a=new _97();
        System.out.println(a.factorial(20));
    }
    @Test
    public void T_98(){
        _98 a=new _98();
//        增强for循环
        a.I_1();
//        获取entrySet，里面包含entry实体
        a.I_2();
//         先map.keySet()再根据map.get(key) 来获取value
        a.I_3();
    }
    @Test
    public void T_99(){
        _99 a=new _99();
//        增强for循环
        a.I_1();
//        for循环原始方式
        a.I_2();
//        迭代器
        a.I_3();
//        for_each
        a.I_4();
    }
    @Test
    public void T_100() throws IOException {
        _100 a=new _100();
        a.transcoding();
    }
    @Test
    public void T_101(){
        _101 a=new _101();
        LocalDate date1 = LocalDate.of(2021, 4, 16);
        LocalDate date2 = LocalDate.of(2021, 4, 15);
        a.differentDay(date1,date2);
    }
    @Test
    public void T_102(){
        _102 a=new _102();
        LocalDateTime date1 = LocalDateTime.now();
//        date1 = LocalDateTime.of(2021, 4, 1,12,59,59);
        a.format(date1);
    }
    @Test
    public void T_103(){
        _103 a=new _103();
        a.examine();
    }
    @Test
    public void T_104(){
        _104 a=new _104();
        a.DayOfYear(2022,4,16);
    }
    @Test
    public void T_105(){
        _105 a=new _105();
        int[][] array = {
                { 12, 34, 68, 32, 9, 12, 545 },
                { 34, 72, 82, 57, 56, 0, 213 },
                { 12, 34, 68, 32, 21, 945, 23 },
                { 91, 10, 3, 2354, 73, 34, 18 },
                { 12, 83, 189, 26, 27, 98, 33 },
                { 47, 23, 889, 24, 899, 23, 657 },
                { 12, 34, 68, 343, 878, 235, 768 },
                { 12, 34, 98, 56, 78, 12, 546 },
                { 26, 78, 2365, 78, 34, 256, 873 }
        };
        a.sortIntArrays(array,6,false);
        for (int[] A:array){
            System.out.println(Arrays.toString(A));
        }
    }
}

